<style type="text/css">
	.form-horizontal .control-label{
		margin-bottom: 0;
		margin-top: 0;
		padding-top: 0;
	}
</style>
<h3><?php echo Yii::t('helpdesk','New password'); ?></h3>

<?php 
foreach(Yii::app()->user->getFlashes() as $key => $message){
	echo '<div class="'.$key.'"><p>'.$message."</p></div>\n";
}
?>

<form role="form" class="form-horizontal" method="post" id="frmRegister">

<div class="form-group">
	<label for="password" class="col-sm-2 control-label"><?php echo Yii::t('helpdesk','Password'); ?></label>
	<div class="col-sm-3">
	<input type="password" required="" placeholder="<?php echo Yii::t('helpdesk','Password'); ?>" name="password" id="password" class="form-control" maxlength="128">
	</div>
</div>
<div class="form-group">
	<label for="re_password" class="col-sm-2 control-label"><?php echo Yii::t('helpdesk','Retype password'); ?></label>
	<div class="col-sm-3">
	<input type="password" required="" placeholder="<?php echo Yii::t('helpdesk','Retype password'); ?>" name="re_password" id="re_password" class="form-control" maxlength="128">
	</div>
</div>
<div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button class="btn btn-primary" type="submit"><?php echo Yii::t('helpdesk','Save'); ?></button>
    </div>
</div>
</form>
<script>
$(document).ready(function(){
	$('#frmRegister').validate({
		rules: {
			password: {
				noSpace: true,
				minlength: 5
			},
			re_password: {
				equalTo: "#password"
			}
		}
	});
	$.validator.addMethod("noSpace", function(value, element) {
		return (value.indexOf(" ") == -1) || (value.indexOf(" ") < 0 && value != ""); 
	}, "this field requires no space");
});
</script>